/*
 * TestJobPoll.cpp
 *
 *   Created on: 2010-3-30     
 *  Description: 
 *    Copyright: 2010 @ ICT Li Heyuan
 */

#include "../include/thread/JobPoll.h"
#include "../include/method/RpcMethod.h"

#include <sys/time.h>
#include <iostream>
using std::cout;
using std::endl;

void testJobPoll()
{
	//构造Conn
	Conn *p = NULL;

	//构造JobPoll
	JobPoll *poll = JobPoll::getInstance(2);
	for (int i = 0; i < 100; i++)
	{
		poll->addJob(p);
	}
}

struct timeval tv1, tv2;
void start()
{
	gettimeofday(&tv1, NULL);
}

void end()
{
	gettimeofday(&tv2, NULL);
	unsigned long timeuse = 1000000 * (tv2.tv_sec - tv1.tv_sec) + tv2.tv_usec
			- tv1.tv_usec;
	timeuse /= 1000;
	cout << "Cost " << timeuse << " ms" << endl;
}
/*

int main()
{
	start();
	testJobPoll();
	end();
	sleep(100);
}
*/
